From f223eb4deed28f656547acae3dbbe51a6bd6efca Mon Sep 17 00:00:00 2001 From: Gleb Kozyrev Date: Tue, 13 Oct 2015 03:30:44 +0300 Subject: [PATCH] Add `cargo run` exit_code_verbose test --- tests/test_cargo_run.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_cargo_run.rs b/tests/test_cargo_run.rs index a85e7bc28..3ad49c418 100644 --- a/tests/test_cargo_run.rs +++ b/tests/test_cargo_run.rs @@ -105,6 +105,26 @@ test!(exit_code { execs().with_status(2)); }); +test!(exit_code_verbose { + let p = project("foo") + .file("Cargo.toml", r#" + [project] + name = "foo" + version = "0.0.1" + authors = [] + "#) + .file("src/main.rs", r#" + fn main() { std::process::exit(2); } + "#); + + assert_that(p.cargo_process("run").arg("-v"), + execs().with_status(2) + .with_stderr(&format!("\ +Process didn't exit successfully: `target[..]foo` (exit code: 2) +", + ))); +}); + test!(no_main_file { let p = project("foo") .file("Cargo.toml", r#" -- 2.30.2